# -*- coding: utf-8 -*-


from . import controllers
from . import models

from odoo import api, SUPERUSER_ID


def allow_zero_cost(cr, registry):
    env = api.Environment(cr, SUPERUSER_ID, {})
    env['ir.config_parameter'].set_param('stock_account.allow_zero_cost', True)


def clear_allow_zero_cost(cr, registry):
    env = api.Environment(cr, SUPERUSER_ID, {})
    # env['ir.config_parameter'].set_param('stock_account.allow_zero_cost', False)
    env['ir.config_parameter'].search([('key', '=', 'stock_account.allow_zero_cost')]).unlink()

